﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<div class="pull-right">

  <c:choose>
    <c:when test="${param.method eq 'POST'}">
      <ul class="pagination ms-pagination no-margin clearfix form-post-page">
        <c:if test="${page.prePage}">
          <li><a href="javascript:void(0);" data-page="1"><i class="glyphicon glyphicon-step-backward"></i></a></li>
          <li><a href="javascript:void(0);" data-page=${page.currentPage - 1}><i class="glyphicon glyphicon-chevron-left"></i></a></li>
        </c:if>

        <li><p>${page.currentPage}/${page.totalPage}页，共${page.totals}条记录</p></li>

        <c:if test="${page.nextPage}">
          <li><a href="javascript:void(0);" data-page="${page.currentPage + 1}"><i class="glyphicon glyphicon-chevron-right"></i></a></li>
          <li><a href="javascript:void(0);" data-page="${page.totalPage}"><i class="glyphicon glyphicon-step-forward"></i></a></li>
        </c:if>

        <c:if test="${page.totalPage > 1}">
          <li>
            <div class="paging-jump">
              <span>跳转到</span> <input name="page" data-url="${param.url}" data-total="${page.totalPage}" ${not empty param.filter ? 'data-filter="true"' : ''} data-querystring="${param.queryString}" />
              <button type="button" class="btn btn-default go-btn">Go</button>
            </div>
          </li>
        </c:if>

        <c:if test="${not empty param.perPage && param.perPage}">
          <li>
            <div class="paging-jump">
              <span style="margin-left: 10px;">每页条数</span> <input name="perPage" type="number" />
              <button type="button" class="btn btn-default per-page-btn">确认</button>
            </div>
          </li>
        </c:if>
      </ul>
    </c:when>
    <c:otherwise>
      <ul class="pagination ms-pagination no-margin clearfix">
        <c:if test="${page.prePage}">
          <li><a href="${param.url}?${empty param.queryString ? '' : param.queryString}${not empty param.filter ? '&filter=true' : ''}"><i class="glyphicon glyphicon-step-backward"></i></a></li>
          <li><a href="${param.url}?${empty param.queryString ? '' : param.queryString}${not empty param.filter ? '&filter=true' : ''}${empty param.queryString ? '' : '&'}page=${page.currentPage - 1}"><i class="glyphicon glyphicon-chevron-left"></i></a></li>
        </c:if>

        <li><p>${page.currentPage}/${page.totalPage}页，共${page.totals}条记录</p></li>

        <c:if test="${page.nextPage}">
          <li><a href="${param.url}?${empty param.queryString ? '' : param.queryString}${not empty param.filter ? '&filter=true' : ''}${empty param.queryString ? '' : '&'}page=${page.currentPage + 1}"><i class="glyphicon glyphicon-chevron-right"></i></a></li>
          <li><a href="${param.url}?${empty param.queryString ? '' : param.queryString}${not empty param.filter ? '&filter=true' : ''}${empty param.queryString ? '' : '&'}page=${page.totalPage}"><i class="glyphicon glyphicon-step-forward"></i></a></li>
        </c:if>

        <c:if test="${page.totalPage > 1}">
          <li>
            <div class="paging-jump">
              <span>跳转到</span> <input name="page" data-url="${param.url}" data-total="${page.totalPage}" ${not empty param.filter ? 'data-filter="true"' : ''} data-querystring="${param.queryString}" />
              <button type="button" class="btn btn-default go-btn">Go</button>
            </div>
          </li>
        </c:if>

        <c:if test="${not empty param.perPage && param.perPage}">
          <li>
            <div class="paging-jump">
              <span style="margin-left: 10px;">每页条数</span> <input name="perPage" type="number" />
              <button type="button" class="btn btn-default per-page-btn">确认</button>
            </div>
          </li>
        </c:if>
      </ul>
    </c:otherwise>
  </c:choose>
</div>